package ioc07;

public class SomeBean {
    String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    {
        System.out.println("构造代码块执行了"+name);
    }

    public SomeBean() {
        System.out.println("无参构造函数执行了"+name);
    }

    public SomeBean(String name) {
        System.out.println("有参构造函数执行了"+name);
        this.name = name;
        System.out.println("有参构造函数执行了"+name);
    }

    public void a(){
        System.out.println("初始化方法,name="+name);
    }

    public void b(){
        System.out.println("准备销毁,name="+name);
    }

    @Override
    protected void finalize() throws Throwable {
        System.out.println("SomeBean finalize执行了");
        super.finalize();
    }
}
